package com.parenting.service;

import com.parenting.entities.CommodityDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.parenting.model.IMPage;
import com.parenting.request.AddCommodityRequest;
import com.parenting.request.SearchCommodityRequest;
import com.parenting.request.UpdateCommodityRequest;
import com.parenting.request.UpdateStockRequest;
import com.parenting.response.CommodityListResponse;
import com.parenting.response.CommodityResponse;

import java.util.List;

/**
 * <p>
 * 商品信息表 服务类
 * </p>
 *
 * @author 烟台业达-王世玺
 * @since 2021-08-27
 */
public interface CommodityService extends IService<CommodityDO> {

    /***
     * 商品添加
     * @param request  添加对象
     * @param ShopId  店铺ID
     */
    void addCommodity(AddCommodityRequest request, String ShopId);

    /***
     * 商品修改
     * @param request 修改对象
     */
    void updateCommodity(UpdateCommodityRequest request);

    /***
     * 商品删除  支持批量删除
     * @param commodityId 商品ID集合
     */
    void  deleteCommodity(List<String> commodityId);

    /***
     * 商品列表
     * @param searchCommodityRequest
     * @return
     */
    IMPage<CommodityListResponse> getCommodityListByCondition(SearchCommodityRequest searchCommodityRequest);

    /***
     * 查看商品详情
     * @param commodityId 商品ID
     * @return
     */
    CommodityResponse getCommodityByCommodityId(String commodityId);


    /***
     * 库存 计算
     * @param request
     */
     void updateStock(UpdateStockRequest request);



    /***
     * 库存 计算
     *
     */
    void updateStockBy(String commodityId, int number);



     List<CommodityDO> getCommodityDropDown(String shopId);

}
